package com.wds.controller;

import com.wds.domain.JsonResult;
import com.wds.domain.entity.User;
import com.wds.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author WDs , wds8.24@outlook.com
 * @version 1.0
 * @since 2022-11-03 11:34
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户相关接口")
public class UserController {
    @Autowired
    private UserService userService;


    @GetMapping("/userInfo")
    public JsonResult<Object> getUserInfo() {
        return userService.getUserInfo();
    }

    @PutMapping("/userInfo")
    public JsonResult<String> updateUserInfo(@RequestBody User user){
        return userService.updateUserInfo(user);
    }
    @PostMapping("/register")
    public JsonResult<String> register(@RequestBody User user){
        return userService.register(user);
    }


}
